﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

using System.IO;
using UnityEditor;
/// <summary>
/// 导出方法
/// </summary>
public class Exporter
{
    /// <summary>
    /// 获取文件名字
    /// </summary>
    /// <returns></returns>
    private static string GetFolderName()
    {
        return DateTime.Now.ToString("yyyyMMdd_HH");
    }
    /// <summary>
    /// 打包和打开文件
    /// </summary>
    /// <param name="MenuPath"></param>
    /// <param name="FolderPath"></param>
    private static void ExportAndOpen(string FolderPath)
    {
        EditorUtil.ExportFolder("Assets/MyFramework", "_QFramework_" + Exporter.GetFolderName() + ".unitypackage");
        EditorUtil.OpenFolderPath(FolderPath);
    }

    [MenuItem("QFramework/Framework/01.快捷键打包 %e", false, 10)]
    private static void ItemClick()
    {
        ExportAndOpen(Path.Combine(Application.dataPath, "../"));
    }

}
